package topo.action;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import topo.MainFrame;
import topo.data.NodeDevice;
import topo.service.TopoDataManager;
import topo.utils.DialogTools;

public class NodeDeleteAction extends AbstractAction {
    public void actionPerformed(ActionEvent e) {
        NodeDevice node = (NodeDevice) getValue("ActionDataKeyName");
        try {
            TopoDataManager.getInstance().delNode(node);
        } catch (Exception ex) {
            DialogTools.showErroMsg(MainFrame.mainFrame, "删除设备出错!");
            ex.printStackTrace();
        }
    }

    public NodeDeleteAction() {
        super("删除设备");
    }
}